package com.wang.store.service;

import com.wang.store.entity.User;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest
public class UserService {

    @Autowired
    private IUserService iuserService;
    @Test
    public  void reg(){
        try {
            User user = new User();
            user.setUsername("jacket22");
            user.setPassword("12313");
            iuserService.reg(user);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    @Test
    public  void login(){
        User user = iuserService.login("tom002", "123456");
        System.out.println(user);
    }
    @Test
    public  void ChangePassword(){
       iuserService.changePassword(9,"test","1234","123");
    }
    @Test
    public  void getByUid(){
        System.out.println(iuserService.getByUid(9));
    }

    @Test
    public  void ChangeInfo(){
        User user = new User();
        user.setPhone("0151555555");
        user.setGender(1);
        user.setEmail("1515151151@qq.com");
        iuserService.ChangeInfo(9,"汪",user);
    }

    @Test
    public  void ChangeAvatar(){
    iuserService.ChangeAvatar(8,"123123","张伟");


    }


}
